#ifndef _NET_STATISTICS_H_
#define _NET_STATISTICS_H_

#include "netfwd.h"

#pragma once

class NetStatistic
{
public:
    NetStatistic();

    inline void update_opennetfds( int32_t delta )
    {
        m_open_netfds += delta;
    }

    inline void update_readnetbytes( int32_t bytes )
    {
        m_read_netbytes += bytes;
    }

    inline void update_writenetbytes( int32_t bytes )
    {
        m_write_netbytes += bytes;
    }

    inline void update_discardnetbytes( int32_t bytes )
    {
        m_discard_netbytes += bytes;
    }

    inline void update_readdiskbytes( int32_t bytes )
    {
        m_read_diskbytes += bytes;
    }

    inline void update_writediskbytes( int32_t bytes )
    {
        m_write_diskbytes += bytes;
    }

    inline void update_diskioerrors()
    {
        ++m_diskio_errors;
    }

private:
    typedef uint64_t    Counter;
    Counter             m_open_netfds;
    Counter             m_read_netbytes;
    Counter             m_write_netbytes;
    Counter             m_discard_netbytes;
    Counter             m_read_diskbytes;
    Counter             m_write_diskbytes;
    Counter             m_diskio_errors;
};

#endif  //_NET_STATISTICS_H_

